package com.zyht.bank.wechat.http;

import java.util.HashMap;
import java.util.Map;

/**
 * 返回信息
 * 
 * @author dingyaming
 *
 */
public class ResObject {
	private String code;
	
	private String msg;
	
	public ResObject() {
	}
	
	public ResObject(String code, String msg) {
		this.code = code;
		this.msg = msg;
	}
	
	public ResObject(EnumCode code, String msg) {
		if(code!=null){
			this.code = code.name();
		}
		this.msg = msg;
	}

	public void setCode(String code) {
		this.code = code;
	}

	private Map<String,Object> data;

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public String getCode() {
		return code;
	}

	public void setCode(EnumCode code) {
		if (code != null) {
			this.code = code.name();
		}
	}

	public Map<String,Object> getData() {
		return data;
	}
	
	public void setData(Map<String,Object> data) {
		this.data = data;
	}

	public void setData(String key, Object value) {
		if(this.data == null){
			this.data = new HashMap<String, Object>();
		}
		this.data.put(key, value);
	}
}